import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../components/index.vue'
import AboutUs from '../components/aboutUS.vue'
import Address from '../components/address.vue'
import New from '../components/new.vue'
import Product from '../components/product.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/index'
  },
  {
    path:'/index',
    component:Index
  },
  {
    path:'/aboutUs',
    component:AboutUs
  },
  {
    path:'/address',
    component:Address
  },
  {
    path:'/new',
    component:New
  },
  {
    path:'/product',
    component:Product
  }
]

const router = new VueRouter({
  routes
})

router.beforeEach((to, from, next) => {
  //设置标题名称
  document.title="云视车联官网"
  next()
})

export default router
